From: Florian Müllner Date: Thu, 21 Oct 2021 17:50:18 +0000 (+0200) Subject: environment: Apply autoReverse/repeatCount to all transitions X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~536^2^2~111 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=cc5cc0d653ccd307475921bf069773d44b34aa5e;p=gnome-shell.git environment: Apply autoReverse/repeatCount to all transitions Like the old Tweener API, ease() allows to transition multiple properties at once. If autoReverse or repeatCount are specified, they should apply to all transitions, but right now we only set them for the first one. Part-of: --- diff --git a/js/ui/environment.js b/js/ui/environment.js index ccd7dcdaa..ef53e6022 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -201,20 +201,23 @@ function _easeActor(actor, params) { actor.set(params); actor.restore_easing_state(); - let transition = animatedProps.map(p => actor.get_transition(p)) - .find(t => t !== null); + const transitions = animatedProps + .map(p => actor.get_transition(p)) + .filter(t => t !== null); + + transitions.forEach(t => t.set({ repeatCount, autoReverse })); + + const [transition] = transitions; if (transition && transition.delay) transition.connect('started', () => prepare()); else prepare(); - if (transition) { - transition.set({ repeatCount, autoReverse }); + if (transition) transition.connect('stopped', (t, finished) => callback(finished)); - } else { + else callback(true); - } } function _easeActorProperty(actor, propName, target, params) {